package my.jwds.p168;

public class ConvertToTitle {
    public static void main(String[] args) {
        ConvertToTitle o = new ConvertToTitle();
        System.out.println(o.convertToTitle(701));
    }

    public String convertToTitle(int columnNumber) {
        StringBuilder sb = new StringBuilder();
        while(columnNumber > 0){
            int v = --columnNumber % 26;
            sb.append((char)(v+65));
            columnNumber/=26;
        }
        return sb.reverse().toString();
    }
}
